{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import matplotlib.pyplot as plt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "def getlr(index):# 得到每个零点的左右索引，然后取其中值\n",
    "    newindex=[]\n",
    "    for i in index[0]:\n",
    "        if i == index[0,0]:\n",
    "            lasti=i\n",
    "            newindex.append(i)\n",
    "            continue\n",
    "        else:\n",
    "            if i==lasti+1:#如果是连贯的\n",
    "                lasti=i\n",
    "            else:#如果已经断开了，就取上一个\n",
    "                newindex.append(lasti)\n",
    "                lasti = i\n",
    "                newindex.append(i)\n",
    "    newindex.append(index[0,-1])\n",
    "    newindex = np.array(newindex)\n",
    "    newindex = newindex.reshape((-1,2))\n",
    "    new = []\n",
    "    for i in newindex:\n",
    "        new.append(int((i[0]+i[1])/2))\n",
    "    return new"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAD4CAYAAAAXUaZHAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAAgAElEQVR4nO3deXgV5d3/8ff3ZCUJCSQkEbKQhLAKshhWRVAUlapocQFBccWtta1L1fpU+/xaW621rVqXIqjwiKIiCi5ULaKisoV9hxDIRshCyE7Wc//+yPA8kQIJISdzlu/runJlzsw5OZ/B+Lkmc2buW4wxKKWU8i4OuwMopZRqf1ruSinlhbTclVLKC2m5K6WUF9JyV0opL+RvdwCAbt26maSkJLtjKKWUR1m/fn2xMSb6RNvcotyTkpJIT0+3O4ZSSnkUEck62TY9LaOUUl5Iy10ppbyQlrtSSnkhLXellPJCWu5KKeWF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R9vdps2+PWvuwGLrc7awv7cQ1N5wxrgQLgc0/cj2aZJ9F0dcY+4HG785xm9neAfKDe+m9yOxAFLAf2Av8GIu3O2Yr9OJ+mUy5bmv3/MclD9+UcYKO1L9uAJ6z1KTQd7GQA7wNB7fF+OvyAUkp5IY89LaOUUurktNyVUsoLabkrpZQX0nJXSikvpOWulFJeSMtdKaW8kJa7Ukp5of8P6oqtRJI7MowAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "零点坐标为 [-2.23522352  2.23522352]\n"
     ]
    }
   ],
   "source": [
    "def getroot(r=np.linspace(-30,30,10000),f = pow(np.linspace(-30,30,10000),2)-5):\n",
    "    zero = r*0\n",
    "    plt.plot(r,f,r,zero)\n",
    "    plt.show()\n",
    "    index = np.array(np.where(abs(f)<0.1))\n",
    "    new = getlr(index)\n",
    "    print('零点坐标为',r[new])\n",
    "    return r[new]\n",
    "\n",
    "a=getroot()"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
